package com.dubbo.consumer.controller;

import com.dubbo.provider.entity.OrderInfo;
import com.dubbo.provider.service.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    private OrderInfoService orderInfoService;

    @GetMapping("hello")
    public String hello() {
        return "hello";
    }

    @GetMapping("orderInfo/{orderId}")
    public OrderInfo getOrderInfo(@PathVariable(value = "orderId") String orderId) {

        return orderInfoService.getOrderInfoById(orderId);
    }
}
